package com.chushouya.order.constants;



import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

public enum OrderPayTypeEnum implements IEnum<Integer> {
    ALIPAY(1, "在线支付宝付款"),
    WECHAT(2, "微信付款"),
    BANK_CARD(3, "银行卡"),
    CASH(4, "现金"),
    OFFLINE_ALIPAY(5, "线下支付宝付款"),
    CLERK(6, "业务员付款"),
    PARTNER(7, "合作商付款"),
    SUNING(8, "苏宁支付"),
    EMA(9, "易付宝"),
    OTHER(10, "其他"),
    ZFT(11, "直付通"),
    COMPANY_PAY(12,"公司付款"),
    MEITUAN(13,"美团支付"),;

    private Integer value;

    private String desc;

    OrderPayTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer status) {
        for (OrderPayTypeEnum thisEnum : OrderPayTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, status)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
